Skip to content

[Support] Remove an unnecessary cast (NFC) #152442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

pattern is already of const char *.

pattern is already of const char *.
@llvmbot
Copy link
Member

llvmbot commented Aug 7, 2025

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

Changes

pattern is already of const char *.


Full diff: https://github.com/llvm/llvm-project/pull/152442.diff

1 Files Affected:

  • (modified) llvm/lib/Support/regcomp.c (+1-1)
diff --git a/llvm/lib/Support/regcomp.c b/llvm/lib/Support/regcomp.c
index 4ed59823f6f44..f5c47781f3d82 100644
--- a/llvm/lib/Support/regcomp.c
+++ b/llvm/lib/Support/regcomp.c
@@ -305,7 +305,7 @@ llvm_regcomp(llvm_regex_t *preg, const char *pattern, int cflags) {
       return (REG_INVARG);
     len = preg->re_endp - pattern;
   } else {
-    len = strlen((const char *)pattern);
+    len = strlen(pattern);
   }
 
   /* do the mallocs early so failure handling is easy */

@kazutakahirata kazutakahirata merged commit 02fbb6a into llvm:main Aug 7, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250806_cast_llvm_Support_regcomp branch August 7, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants